<template>
  <h1>首页</h1>
  <div>{{msg}}</div>

</template>

<script>
// @ is an alias to /src
import { reactive, ref } from "vue"
import axios from "axios"

export default {
  name: 'Home',
  components: {
  },
  setup () {
    let msg = ref(0)
    let logindata = reactive({
      xuehao: 111111,
      password: "123456"
    })
    return { msg, logindata }
  },
  methods: {
    test () {
      axios.post('http://127.0.0.1:8081/login', this.logindata).then((resule) => {
        this.$message({
          message: resule.data,
          type: 'warning'
        });
        console.log(resule.data)
      }).catch((err) => {
        console.log(err)
      })
    }
  },
  mounted () {
    this.test();
  }
}
</script>
